package com.example.config;

import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

/**
 * @Classname GatewayConfig
 * @Description TODO
 * @Date 2022/3/24 16:06
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@Configuration
public class GatewayConfig {

    /**
     *  根据uir进行限流。
     * @return
     */
    @Bean
    KeyResolver sysKeyResolver(){
        return exchange -> Mono.just(exchange.getRequest().getURI().getPath());
    }



}
